from django.conf.urls import url
from rest_framework_jwt.views import obtain_jwt_token

from . import views

# urlpatterns是被django自动识别的路由列表变量
urlpatterns = [
    # 每个路由信息都需要使用url函数来构造
    # url(路径, 视图)
    # 注册用户注册模块路由
    url(r'^users/$', views.UserAPIView.as_view()),
    # 注册判断用户是否存在路由
    url(r'^usernames/(?P<username>\w{5,20})/count/$', views.UserNameCountView.as_view()),
    # 注册判断手机号是否存在
    url(r'mobiles/(?P<mobile>1[3-9]\d{9})/count/$', views.MobileCountView.as_view()),

    # JWT登录
    url(r'^authorizations/$', obtain_jwt_token),
    # 请求的用户详细信息
    url(r'^user/info/$', views.UserDetailView.as_view()),

    # 用户邮箱
    url(r'^email/$', views.EmailView.as_view()),
    # 校验用户邮箱
    url(r'^emails/verification/$', views.VerifyEmailView.as_view()),
]
